<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalUserOnlineRecord.php 313 2008-11-20 17:04:18Z steen.rabol@gmail.com $
 */

Prado::using('Application.Common.Data.PortalActiveRecord');
Prado::using('Application.Common.Data.PortalUserRecord');

class PortalUserOnlineRecord extends PortalActiveRecord
{
	const TABLE='tbluseronline';

	public $id;
	public $ip;
	public $timestamp;
	public $sessionid;
	public $userid;
	public $page;

	private $_user	= null;

	public static function finder($className=__CLASS__)
	{
		return parent::finder($className);
	}

	public function getUser()
	{
		if($this->_user === null && $this->userid !== null)
		{
			$this->_user	= PortalUserRecord::finder()->findByPk($this->userid);
		}
		return $this->_user;
	}
}
?>